﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.OpenGL;
using System.Threading;
using Silvermoon.OpenGL.Native;

namespace Testing
{
    public class PanoramaImageLoader
    {
        private static PanoramaImageLoader loader;

        public static PanoramaImageLoader Loader
        {
            get
            {
                if (loader == null) loader = new PanoramaImageLoader();
                return loader;
            }
        }

        private PanoramaImageLoader()
            : base()
        {
            //Thread t = new Thread(LoadImage);
            //t.Priority = ThreadPriority.Lowest;
            //t.Start();
        }

        public void LoadImage()
        {
            Image = Texture.FromResource("Testing.Images.panoramic.jpg", TextureFormat.RGB565);
            Loaded(this, EventArgs.Empty);
        }

        public Texture Image { get; private set; }

        public event EventHandler Loaded;
    }
}
